Experiment Overview

Speed control appears in nearly every powered system — jet engine fuel flow, electric motor drives, rotor RPM regulators, and propeller governor systems. The choice of controller architecture fundamentally changes how a system responds to step commands and rejects disturbances. This lab designed and directly compared two controllers for SRV02 motor speed regulation — a PI controller and a lead compensator — using both frequency-domain analysis (Bode plots) and time-domain step response evaluation in simulation and on hardware.

Bode diagram of augmented plant Pi(s) – infinite gain margin, phase margin 87.8° at 1.53 rad/s
Figure 1: Bode diagram of Pi(s) — infinite gain margin, phase margin 87.8°
PI controller – simulated step response, tp=0.04 s, PO=4.4%, zero steady-state error
Figure 2: PI controller — simulated step response, tp=0.04 s, PO=4.4%
Lead compensator – simulated step response, tp=0.04 s, PO=2.0%, zero steady-state error
Figure 3: Lead compensator — simulated step response, tp=0.04 s, PO=2.0%

Equipment & Tools

Frequency-Domain Analysis

The plant including an integrator, Pi(s) = K / [s(τs+1)], was analyzed in frequency domain. The magnitude response is |Pi(jω)| = K / [ω√(1 + (τω)²)], which rolls off at −20 dB/decade from the origin pole, steepening to −40 dB/decade above ω = 1/τ = 39.4 rad/s. The phase starts at −90° and asymptotes toward −180° but never reaches it — giving the system an infinite gain margin. The phase margin was 87.8° at the gain crossover of 1.53 rad/s, indicating excellent stability robustness. Since one pole sits exactly at the origin, Pi(s) is marginally stable.

Key Results

Controller / Testtp (s)PO (%)ess (rad/s)
PI — simulation0.044.40
PI — hardware0.03423.8−3.2 × 10⁻⁵
Lead — simulation0.042.00
Lead — hardware0.0344.4−0.0012
PI controller – hardware step response, tp=0.034 s, PO=23.8% due to encoder noise
Figure 4: PI controller — hardware step response, PO=23.8%
PI controller – steady-state speed signal showing 1.16 rad/s peak-to-peak encoder noise ripple
Figure 5: PI controller — steady-state speed showing 1.16 rad/s encoder noise ripple
Lead compensator – hardware step response, PO=44.4% driven by derivative amplification of encoder noise
Figure 6: Lead compensator — hardware step response, PO=44.4%

MATLAB Code

The Bode plot was generated using MATLAB’s margin() function on the Pi(s) transfer function. Step response plots overlaid setpoint and measured speed, and steady-state error was computed over a time-averaged settling window.

% Augmented plant: Pi(s) = K / [s(tau*s + 1)]
K = 1.53;  tau = 0.0254;
s = tf('s');
Pi = K / (s * (tau*s + 1));
margin(Pi)    % Gm = Inf, Pm = 87.8 deg at 1.53 rad/s

% Step response overlay
plot(data_spd(:,1), data_spd(:,2))   % setpoint
hold on
plot(data_spd(:,1), data_spd(:,3))   % measured
xlabel('Time (s)');  ylabel('Speed (rad/s)')
legend('Setpoint', 'Measured')

% Steady-state error over settling window
index = (time >= 4.9) & (time <= 9.9);
e_ss  = mean(r(index)) - mean(y(index));  % ≈ -3.17e-5 rad/s (PI)

Valuable Takeaways

← Back to Dynamics & Control Labs